{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
    <script src="{% static 'layui/layui.js' %}"></script>
    <script src="{% static 'js/jquery.js' %}"></script>
</head>
<body>
<form class="layui-form" lay-filter="example">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="userName" lay-verify="title" autocomplete="off" placeholder="请输入用户名"
                       class="layui-input" lay-verify="required" value="{{ user.user_name }}">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline">
                <input type="text" name="email" lay-verify="email" autocomplete="off" placeholder="请输入邮箱"
                       class="layui-input" value="{{ user.user_email }}">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="password" name="pwd" lay-verify="pass" placeholder="请输入密码" autocomplete="off"
                   class="layui-input" value="{{ user.user_password }}">
            <input type="hidden" name="oldPwd" value="{{ user.user_password }}">
            <input type="hidden" name="userId" value="{{ user.user_id }}">
        </div>
        <div class="layui-form-mid layui-word-aux">请填写6到12位密码</div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">角色</label>
            <div class="layui-input-block">
                <select name="roleId">
                    <option value="1" {% ifequal user.user_role.id 1 %}selected{% endifequal %}>图书管理员</option>
                    <option value="2" {% ifequal user.user_role.id 2 %}selected{% endifequal %}>学生</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button id="submitBtn" class="layui-btn" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script src="{% static 'js/users/edit.js' %}"></script>
</html>